package org.RSG.Interface;

import java.awt.event.*;

import javax.swing.*;

import org.RSG.Application.*;

public class MenuBar implements ActionListener
{
	public JMenuBar menubar;
	
	public MenuBar()
	{
		this.menubar = new JMenuBar();
		JMenu filemenu = new JMenu("File");
		JMenuItem item = new JMenuItem("New");
		item.addActionListener(this);
		filemenu.add(item);
		item = new JMenuItem("Save");
		item.addActionListener(this);
		filemenu.add(item);
		this.menubar.add(filemenu);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
			if(e.getActionCommand() == "New")
			{
				System.out.println("New");
				NewDialog n = new NewDialog();
				Application.appdesktop.desktop.add(n.window);
			} else if(e.getActionCommand() == "Save") {
				Application.Save();
			}
	}
}